<template>
    <div class="devices" device-num="0">
      <div class="devLeft">
        <div class="left-box" style="display: block;">
          <div class="deviceSucc">
            <sector-gauge :radius="45"
                          :path="[28, 40, 100, '#005C5E']"
                          :text="`0.00`"></sector-gauge>
            <p class="succPercent">{{ device_data.succ_percent }}</p>
            <p class="succText">成功率(%)</p>
          </div>
          <div class="deviceRr">
            <sector-gauge :radius="45"
                          :path="[28, 40, 100, '#00567B']"
                          :text="`0.00`"></sector-gauge>
            <p class="rrPercent">{{device_data.rr_percent}}</p>
            <p class="rrText">响应率(%)</p>
          </div>
          <div class="deviceResp">
            <p class="respScreen">{{device_data.resp_time}}</p>
            <p class="respText">响应时间(ms)</p>
          </div>
          <div class="deviceTrans">
            <p class="transScreen">{{device_data.trans_num}}</p>
            <p class="transText">交易量(笔)</p>
          </div>
        </div>
        <!-- <div class="sourIpList" style="display: none;">
         <div class="closeIps">X</div>
         <div class="sourIpTable">
           <div class="sourIpTh"><p>源 IP</p>
             <p>设备名称</p></div>
           <div class="sourIpTb mCustomScrollbar _mCS_332 mCS-autoHide mCS_no_scrollbar"
                style="position: relative; overflow: visible;">
             <div id="mCSB_332" class="mCustomScrollBox mCS-minimal mCSB_vertical mCSB_outside" tabindex="0"
                  style="max-height: 195px;">
               <div id="mCSB_332_container" class="mCSB_container mCS_y_hidden mCS_no_scrollbar_y"
                    style="position:relative; top:0; left:0;" dir="ltr"><p>1.1.1.20</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.18</p>
                 <p class="ip_name"></p>
                 <p>10.1.34.21</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.19</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.16</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.17</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.14</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.15</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.12</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.13</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.10</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.11</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.4</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.5</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.6</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.7</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.1</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.2</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.3</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.8</p>
                 <p class="ip_name"></p>
                 <p>1.1.1.9</p>
                 <p class="ip_name"></p></div>
             </div>
             <div id="mCSB_332_scrollbar_vertical"
                  class="mCSB_scrollTools mCSB_332_scrollbar mCS-minimal mCSB_scrollTools_vertical"
                  style="display: none;">
               <div class="mCSB_draggerContainer">
                 <div id="mCSB_332_dragger_vertical" class="mCSB_dragger"
                      style="position: absolute; min-height: 50px; top: 0px;">
                   <div class="mCSB_dragger_bar" style="line-height: 50px;"></div>
                 </div>
                 <div class="mCSB_draggerRail"></div>
               </div>
             </div>
           </div>
         </div>
       </div>-->
      </div>
      <div class="devRight"><p class="deviceModule">设备型号:{{ device_data.device_model || '未知' }}</p>
        <p class="deviceType">设备类型:{{ device_data.device_type || '未知' }}</p>
        <p class="deviceDestPorts">目标端口:{{ device_data.dst_ports }}</p>
        <p class="deviceDestIp">目标IP:{{ device_data.dst_ip }}</p>
        <p class="deviceSrcPorts">源端口:{{ device_data.src_ports}}</p>
        <p class="deviceSourIp">
          <span>源IP:</span>
          <!--<img src="/static/dist/img/cbms-img/overview/sourceIp.svg"
               alt="查看源ips"></p>-->
        <p class="deviceName">{{ device_data.device_name || '未知设备' }}</p>
      </div>
    </div>

</template>
<script>
  import SectorGauge from '@/components/svg/SectorGauge'
  export default {
    name: 'device',
    components: {
      'sector-gauge': SectorGauge,
    },
    props: {
      device_data: {
        type: Object,
        default() {
          return {
            device_model: '',
            device_type: '',
            dst_ports: '',
            dst_ip: '',
            src_ports: '',
            device_name: '',
            succ_percent: 0.00,
            rr_percent: 0.00,
            resp_time: 0.00,
            trans_num: 0
          }
        }
      }
    }
  }
</script>
<style scoped>
  /*@import '@/assets/css/overview_single.css';*/

  *{
    margin: 0 auto;
    padding: 0;
  }
  .devices{
    width: 400px;
    height: 250px;;
    margin: 30px auto;
    border: 1px solid #174469;
    border-radius: 3px;
    background: rgba(3, 8, 13,.6);
    box-shadow: 3px 5px 5px rgba(0,0,0,0.6);
  }
  .devLeft{
    width: 229px;
    float: left;
    height: 100%;
    background: #152A3D;
    border-right: 1px solid #0d3555;
    color: #ddd;
  }
  .devRight{
    width: 170px;
    float: left;
    height: 100%;
    background: #102030;
    color: #ddd;
  }
  .deviceSucc{
    width: 90px;
    float: left;
    height: auto;
    margin: 10px 12px;
    direction: ltr;
  }
  .deviceRr{
    width: 90px;
    float: left;
    height: auto;
    margin: 10px 12.5px;
    direction: ltr;
  }
  .deviceResp{
    margin-top: 10px;
    width: 50%;
    float: left;
    height: auto;
    direction: ltr;
  }
  .deviceTrans{
    margin-top: 10px;
    width: 50%;
    float: left;
    height: auto;
    direction: ltr;
  }
  .succSector{
    fill:#00BCAA
  }
  .succSector .sectorBg{
    fill:#005C5E
  }
  .rrSector{
    fill:#009BDA;
  }
  .rrSector .sectorBg{
    fill:#00567B;
  }
  .succText{
    width: 100%;
    text-align: center;
  }
  .rrText{
    width: 100%;
    text-align: center;
  }
  .respScreen{
    width: 90px;
    margin: 0 auto;
    font-size: 20px;
    background: #285D7D;
    border-radius: 3px;
    text-align: center;
    height: 40px;
    line-height: 40px;
    color: #e8e8e8;
  }
  .respText{
    text-align: center;
    margin-top: 10px;
  }
  .transScreen{
    width: 90px;
    text-align: center;
    margin: 0 auto;
    font-size: 20px;
    border-radius: 3px;
    background: #285D7D;
    height: 40px;
    line-height: 40px;
    color: #e8e8e8;
  }
  .transText{
    text-align: center;
    margin-top: 10px;
  }
  /**æºipåˆ—è¡¨**/
  .sourIpList{
    height: 100%;
  }
  .closeIps{
    margin-left: 200px;
    padding-left: 10px;
    padding-top: 3px;
    cursor: pointer;
  }
  .sourIpTable{
    width: calc(100% - 1px);
    padding-right: 10px;
    text-align: center;
    line-height: 28px;
  }
  .sourIpTable p{
    display: inline-block;
    float: left;
    width: 50%;
    height: 28px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow: ellipsis;
  }
  .deviceModule{
    height: 25px;
    line-height: 25px;
    text-align: left;
    padding-left: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .deviceType{
    height: 25px;
    line-height: 25px;
    text-align: left;
    padding-left: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .deviceDestPorts{
    height: 25px;
    line-height: 25px;
    text-align: left;
    padding-left: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .deviceDestIp{
    height: 25px;
    line-height: 25px;
    text-align: left;
    padding-left: 10px;
  }
  .deviceSrcPorts{
    height: 25px;
    line-height: 25px;
    text-align: left;
    padding-left: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .deviceSourIp{
    height: 25px;
    line-height: 25px;
    text-align: left;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .deviceModule,.deviceType,.deviceDestPorts,deviceDestIp,.deviceSrcPorts,.deviceSourIp{
    height: 37px;
    line-height: 37px;
  }
  .deviceSourIp span{
    display: block;
    width: 38px;
    float: left;
  }
  .deviceSourIp img{
    height: 30px;
    padding-top: 3px;
    cursor: pointer;
    vertical-align: -10px;
  }
  .deviceName{
    width: 100%;
    height: 40px;
    background: #213153;
    color:#22ece0 ;
    font-size: 18px;
    line-height: 40px;
    float: left;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  svg text{
    color: #fff;
  }
</style>
